<?php defined('BASEPATH') or exit('No direct script access allowed');
class Plugin_Text extends Plugin
{
	public function clear(){
		$str      = $this->attribute('value');
		$length      = $this->attribute('length') ? $this->attribute('length') : 20;
		$result = "";
		if(strlen($str) <= $length)
			$result = $str;
		else
			$result = substr($str,0,$length) .' ...';
		return $result;
	}
	
	public function toupper(){
		$str      = $this->attribute('value');
		return mb_strtoupper($str);
	}
	
	public function nl2br(){
		$str      = $this->attribute('value');
		return nl2br($str);
	}
}
